﻿
@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>Admin | Log in</title>
    <!-- Tell the browser to be responsive to screen width -->
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <!-- Bootstrap 3.3.6 -->
    <link rel="stylesheet" href="~/Content/libs/bootstrap/dist/css/bootstrap.min.css">
    <!-- Font Awesome -->
    <link rel="stylesheet" href="~/Content/libs/font-awesome/css/font-awesome.min.css">
    <!-- Ionicons -->
    <link rel="stylesheet" href="~/Content/libs/Ionicons/css/ionicons.min.css">
    <!-- Theme style -->
    <link rel="stylesheet" href="~/Content/libs/adminlte/dist/css/AdminLTE.min.css">
    <!-- iCheck -->
    <link rel="stylesheet" href="~/Content/libs/iCheck/square/blue.css">

    <!--[if lt IE 9]>
     <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>
<body class="hold-transition login-page" style="background:#fff url(../../Content/image/banner.jpg) no-repeat  fixed center;background-size:cover;overflow:hidden;">

    <div class="login-box" id="LoginBox">
        <div class="login-logo">
            <a href="/"><b>Admin Manage System</b></a>
        </div>
        <!-- /.login-logo -->
        <div class="login-box-body">
            <p class="login-box-msg">Sign in to start your session</p>

                <div class="form-group has-feedback">
                    <input type="text" class="form-control" placeholder="UserName" v-model="UserName">
                    <span class="glyphicon glyphicon-user form-control-feedback"></span>
                </div>
                <div class="form-group has-feedback">
                    <input type="password" class="form-control" placeholder="Password" v-model="Password">
                    <span class="glyphicon glyphicon-lock form-control-feedback"></span>
                </div>
                <div class="row">
                    <div class="col-xs-8">
                        <div class="checkbox icheck">
                            <label>
                                <div class="icheckbox_square-blue" aria-checked="false" aria-disabled="false" style="position: relative;"><input type="checkbox" style="position: absolute; top: -20%; left: -20%; display: block; width: 140%; height: 140%; margin: 0px; padding: 0px; background: rgb(255, 255, 255); border: 0px; opacity: 0;">
                                <ins class="iCheck-helper" style="position: absolute; top: -20%; left: -20%; display: block; width: 140%; height: 140%; margin: 0px; padding: 0px; background: rgb(255, 255, 255); border: 0px; opacity: 0;"></ins></div> Remember Me
                            </label>
                        </div>
                    </div>
                    <!-- /.col -->
                    <div class="col-xs-4">
                        <button type="button" class="btn btn-primary btn-block btn-flat" v-on:click="check()">Sign In</button>
                    </div>
                    <!-- /.col -->
                </div>


            <!-- /.social-auth-links -->

            @*<a href="#">I forgot my password</a><br>
            <a href="register.html" class="text-center">Register a new membership</a>*@

        </div>
        <!-- /.login-box-body -->
    </div>
    <!-- /.login-box -->
    <!-- jQuery 2.2.3 -->
    <script src="~/Content/libs/jQuery/dist/jquery.min.js"></script>
    <!-- Bootstrap 3.3.6 -->
    <script src="~/Content/libs/bootstrap/dist/js/bootstrap.min.js"></script>
    <!-- iCheck -->
    <script src="~/Content/libs/iCheck/icheck.min.js"></script>
    <!--Vue-->
    <script src="~/Content/libs/Vue/vue.min.js"></script>
    <!--Layer-->
    <script src="~/Content/libs/layer/layer.js"></script>
    <!--Layer-->
    <script src="~/Content/js/admin.js"></script>
    <script>
    
        var loginApp = new Vue({
            el: '#LoginBox',
            data: {
                UserName: "admin",
                Password: "123",
                LoginCode:''
            },
            mounted: function () {
                //美化checkbox
                $('input').iCheck({
                    checkboxClass: 'icheckbox_square-blue',
                    radioClass: 'iradio_square-blue',
                    increaseArea: '20%' // optional
                });
                //稍微延迟加载
                this.$nextTick(function () {
                $(document).keydown(function (e) {
                    if (e.which == 13) {
                        loginApp.check();
                    }
                });
            });
            },
            methods: {
                check: function () {
                    if (!this.UserName) return admin.msg("Please enter one user name!", "warning");
                    if (!this.Password) return admin.msg("Please input a password!", "warning");
                    //if (!this.LoginCode) return admin.msg("请输入验证码", "警告");
                    admin.ajax({
                        url: '@Url.Action("Check")',
                        data: this.$data,
                        loading: true,
                        success: function (r) {
                            if (r.status == 1) {
                                admin.setCookie('Authorization', r.data.token);
                                top.window.location = r.data.jumpurl;
                            }
                        }
                    });
                }
            }
        });
    </script>


</body>
</html>
